package com.alibaba.citrus.cr.mn.order.center.common.util;

import com.alibaba.acm.shaded.org.codehaus.jackson.map.ObjectMapper;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;

/**
 * @auther dongju.fyj
 * @date 2023/6/8
 */
public class JsonUtils {

    /**
     * 校验字符是否是JSON格式
     */
    public static boolean isValidJson(String json) {
        try {
            if (StringUtils.isBlank(json)) {
                return true;
            }
            JSON.parseObject(json);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}
